package Entities;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "SolicitudCompras")
public class SolicitudComprasBean implements Serializable {

	public SolicitudComprasBean(){
		
	}
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private int idSolicitud;
	private Date fechaEmision;
	private List<ItemSolicitudCompraBean> itemsSolicitud;

	@Id
	@Column(name = "idSolicitud", nullable = false)
	public int getidSolicitud() {
		return idSolicitud;
	}

	public void setidSolicitud(int idSolicitud) {
		this.idSolicitud = idSolicitud;
	}

	@Column(name = "fechaEmision", nullable = false)
	public Date getFechaEmision() {
		return fechaEmision;
	}

	public void setFechaEmision(Date fechaEmision) {
		this.fechaEmision = fechaEmision;
	}
	
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
	@JoinColumn(name = "idSolicitud", nullable = false)
	public List<ItemSolicitudCompraBean> getItemsSolicitud() {
		return itemsSolicitud;
	}
	
	public void setItemsSolicitud(List<ItemSolicitudCompraBean> itemsSolicitud) {
		this.itemsSolicitud = itemsSolicitud;
	}

	

}
